package kevin.study.zephyr.domain.model.view.soda;

import kevin.study.zephyr.domain.dao.soda.ZConstraint;
import kevin.study.zephyr.domain.soda.Constraint;

/**
 * @author Kevin.Huang
 * @createtime 2007-12-12
 */
public class VConstraint implements Constraint {

	private ZConstraint fieldConstraint;

	private ZConstraint zConstraint;

	protected VConstraint(ZConstraint fieldConstraint, ZConstraint zc) {
		this.fieldConstraint = fieldConstraint;
		this.zConstraint = zc;
	}

	public Constraint and(Constraint with) {
		fieldConstraint.and(((VConstraint) with).getFieldConstraint());
		return this;
	}

	public Constraint contains() {
		zConstraint.contains();
		return this;
	}

	public Constraint endsWith(boolean caseSensitive) {
		zConstraint.endsWith(caseSensitive);
		return this;
	}

	public Constraint equal() {
		zConstraint.equal();
		return this;
	}

	public Object getObject() {
		return zConstraint.getObject();
	}

	public Constraint greater() {
		zConstraint.greater();
		return this;
	}

	public Constraint like() {
		zConstraint.like();
		return this;
	}

	public Constraint not() {
		zConstraint.not();
		return this;
	}

	public Constraint or(Constraint with) {
		zConstraint.or(((VConstraint) with).getFieldConstraint());
		return this;
	}

	public Constraint smaller() {
		zConstraint.smaller();
		return this;
	}

	public Constraint startsWith(boolean caseSensitive) {
		zConstraint.startsWith(caseSensitive);
		return this;
	}

	/**
	 * @return the zConstraint
	 */
	public ZConstraint getZConstraint() {
		return zConstraint;
	}

	/**
	 * @return the fieldConstraint
	 */
	public ZConstraint getFieldConstraint() {
		return fieldConstraint;
	}

}
